using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace SurveyHost.Web
{
    public partial class Error : System.Web.UI.Page
    {
        private const string errorUnknown = @"
An unknown error has occurred.
<br/>
<br/>
The administrator has been notified.  Please try again later.
";
        private const string error403 = @"
You are not allowed to view this resource.
<br />
From this point, you may return <a href=" + "\"default.aspx\"" + @">to the start page</a>.
";
        private const string error404 = @"
You have attempted to view a resource that is not available on the server.
<br />
From this point, you may return <a href=" + "\"default.aspx\"" + @">to the start page</a>.
";

        protected void Page_Load(object sender, EventArgs e)
        {
            string errorMessage;

            string type = this.Request.Params["error"];

            switch (type)
            {
                case "404":
                    errorMessage = error404;
                    break;
                case "403":
                    errorMessage = error403;
                    break;
                default:
                    errorMessage = errorUnknown;
                    break;
            }

            TextArea.InnerHtml = errorMessage;
        }
    }
}
